/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JF_User.java
 *
 * Created on Mar 8, 2012, 4:32:33 PM
 */

package InterfaceGUI;

import java.awt.event.MouseEvent;

/**
 *
 * @author BinhNV_A04911
 */
public class EmployeeInformation extends javax.swing.JDialog {

    /** Creates new form JF_User */
    public EmployeeInformation(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        txtFullNameInformation = new javax.swing.JTextField();
        txtAccountInformation = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtPasswordInformation = new javax.swing.JPasswordField();
        txtConfrimPasswordInformation = new javax.swing.JPasswordField();
        jLabel7 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        txtEmailInformation = new javax.swing.JTextField();
        cboEmailInformation = new javax.swing.JComboBox();
        btnEditInformation = new javax.swing.JButton();
        btnDelInformation = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbeUserInformation = new javax.swing.JTable(){
            public String getToolTipText(MouseEvent e) {
                String tip = null;
                java.awt.Point p = e.getPoint();
                int rowIndex = rowAtPoint(p);
                int colIndex = columnAtPoint(p);
                int realColumnIndex = convertColumnIndexToModel(colIndex);

                tip =  getValueAt(rowIndex, colIndex)+"";
                if(tip.length()>100){
                    tip=tip.replaceAll("\\.", "<br>");
                }

                return "<html>"+tip;
            }
        };
        btnCreateAccountInformation = new javax.swing.JButton();
        btnClearInformation = new javax.swing.JButton();
        btnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLabel1.setText("FullName:");

        txtAccountInformation.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtAccountInformationFocusLost(evt);
            }
        });

        jLabel2.setText("Account:");

        jLabel3.setText("PassWord:");

        txtConfrimPasswordInformation.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtConfrimPasswordInformationFocusLost(evt);
            }
        });

        jLabel7.setText("ConfrimPassword:");

        jLabel4.setText("Email:");

        txtEmailInformation.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtEmailInformationFocusLost(evt);
            }
        });

        cboEmailInformation.setEditable(true);
        cboEmailInformation.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "yahoo.com", "gmail.com", "hotmail.com", "live.com" }));
        cboEmailInformation.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cboEmailInformationItemStateChanged(evt);
            }
        });
        cboEmailInformation.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                cboEmailInformationFocusLost(evt);
            }
        });

        btnEditInformation.setText("Edit");
        btnEditInformation.setEnabled(false);
        btnEditInformation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditInformationActionPerformed(evt);
            }
        });

        btnDelInformation.setText("Del");
        btnDelInformation.setEnabled(false);
        btnDelInformation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDelInformationActionPerformed(evt);
            }
        });

        tbeUserInformation.setAutoCreateRowSorter(true);
        tbeUserInformation.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tbeUserInformation.setGridColor(java.awt.SystemColor.controlHighlight);
        tbeUserInformation.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbeUserInformationMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tbeUserInformation);

        btnCreateAccountInformation.setText("Create Account");
        btnCreateAccountInformation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCreateAccountInformationActionPerformed(evt);
            }
        });

        btnClearInformation.setText("Clear");
        btnClearInformation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClearInformationActionPerformed(evt);
            }
        });

        btnCancel.setText("Cancel");
        btnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 531, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(btnDelInformation, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
                                        .addComponent(btnEditInformation, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 413, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(btnCreateAccountInformation)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(btnClearInformation)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(btnCancel))))
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel3)
                                .addComponent(jLabel2)
                                .addComponent(jLabel1)
                                .addComponent(jLabel7)
                                .addComponent(jLabel4))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(11, 11, 11)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtAccountInformation)
                                        .addComponent(txtFullNameInformation, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
                                        .addComponent(txtPasswordInformation, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)))
                                .addGroup(layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtConfrimPasswordInformation, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
                                        .addComponent(txtEmailInformation))))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cboEmailInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(103, 103, 103)))
                    .addContainerGap()))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 449, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(txtFullNameInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2)
                        .addComponent(txtAccountInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(txtPasswordInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(txtConfrimPasswordInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(8, 8, 8)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtEmailInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel4)
                        .addComponent(cboEmailInformation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(20, 20, 20)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(17, 17, 17)
                            .addComponent(btnEditInformation)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btnDelInformation))
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(btnCancel)
                        .addComponent(btnClearInformation)
                        .addComponent(btnCreateAccountInformation))
                    .addContainerGap()))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtAccountInformationFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtAccountInformationFocusLost
     
}//GEN-LAST:event_txtAccountInformationFocusLost

    private void txtConfrimPasswordInformationFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtConfrimPasswordInformationFocusLost
       
}//GEN-LAST:event_txtConfrimPasswordInformationFocusLost

    private void txtEmailInformationFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtEmailInformationFocusLost
    
}//GEN-LAST:event_txtEmailInformationFocusLost

    private void cboEmailInformationItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboEmailInformationItemStateChanged
       
}//GEN-LAST:event_cboEmailInformationItemStateChanged

    private void cboEmailInformationFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_cboEmailInformationFocusLost
     
}//GEN-LAST:event_cboEmailInformationFocusLost

    private void btnEditInformationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditInformationActionPerformed

    }//GEN-LAST:event_btnEditInformationActionPerformed

    private void btnDelInformationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDelInformationActionPerformed
      
     
}//GEN-LAST:event_btnDelInformationActionPerformed

    private void tbeUserInformationMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbeUserInformationMouseClicked
  
    }//GEN-LAST:event_tbeUserInformationMouseClicked

    private void btnCreateAccountInformationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCreateAccountInformationActionPerformed

       
}//GEN-LAST:event_btnCreateAccountInformationActionPerformed

    private void btnClearInformationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClearInformationActionPerformed

}//GEN-LAST:event_btnClearInformationActionPerformed

    private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
        this.dispose();
}//GEN-LAST:event_btnCancelActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                EmployeeInformation dialog = new EmployeeInformation(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCancel;
    private javax.swing.JButton btnClearInformation;
    private javax.swing.JButton btnCreateAccountInformation;
    private javax.swing.JButton btnDelInformation;
    private javax.swing.JButton btnEditInformation;
    private javax.swing.JComboBox cboEmailInformation;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable tbeUserInformation;
    private javax.swing.JTextField txtAccountInformation;
    private javax.swing.JPasswordField txtConfrimPasswordInformation;
    private javax.swing.JTextField txtEmailInformation;
    private javax.swing.JTextField txtFullNameInformation;
    private javax.swing.JPasswordField txtPasswordInformation;
    // End of variables declaration//GEN-END:variables

}
